#include "include/findwidget.h"

#include <QtGui/QtGui>

FindWidget::FindWidget()
{
    setFixedSize(300, 150);
    setWindowTitle("Find...");

    QFont font("Monospace");
    font.setStyleHint(QFont::TypeWriter);

    // Label
    findLabel = new QLabel("Enter find string: ");
    //findLabel->setFont(font);

    // QTextEdit fot enter find string
    findStr = new QLineEdit;
    findStr->setFont(font);

    // Button
    findButton = new QPushButton("Find");
    findButton->resize(50, 20);
    //findButton->setFont(font);

    // Composition
    layout = new QVBoxLayout;
    layout->addWidget(findLabel);
    layout->addSpacing(5);
    layout->addWidget(findStr);
    layout->addSpacing(30);
    layoutButton = new QHBoxLayout;
    layoutButton->addSpacing(90);
    layoutButton->addWidget(findButton);
    layoutButton->addSpacing(90);
    layout->addLayout(layoutButton);
    layout->addSpacing(10);
    setLayout(layout);
}

void FindWidget::closeEvent(QCloseEvent *event)
{
    emit findClose();
    event->accept();
}
